<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/11/29/029
 * Time: 16:41
 */

namespace app\api\controller\v1;

use app\api\controller\BaseController;
use app\api\model\Shop as ShopModel;
use app\api\validate\IDMustBePostiveInt;
use app\api\validate\LatLngValidate;
use app\api\validate\ShopValidate;
use app\lib\exception\SuccessMessage;

class Shop extends BaseController {

    /**
     * 添加或者编辑店铺申请
     * @return SuccessMessage
     */
    public function createOrUpdateShop() {
        $shopValidate = new ShopValidate();
        $shopValidate->goCheck();
        $params = $shopValidate->getDataByRule(input('post.'));
        ShopModel::saveShop($params);
        return new SuccessMessage();
    }

    /**
     * 获取店铺量体师列表
     * @return array
     */
    public function shopPatternMaster() {
        return ShopModel::shopPatternMaster();
    }
}